import request from "@/utils/request";
import type {
  GetRoleListApiParams,
  GetRoleListApiResponse,
} from "./model/roleModel";

enum Api {
  getRoleList = "/admin/acl/role",
   getRoleSave ="/admin/acl/role/save"
}

// 获取角色分页列表
export const getRoleListApi = ({
  page,
  limit,
  roleName,
}: GetRoleListApiParams) => {
  return request.get<any, GetRoleListApiResponse>(
    `${Api.getRoleList}/${page}/${limit}`,
    {
      params: {
        roleName,
      },
    }
  );
};


export const saveRoleApi = (roleName: string) => {
  return request.post<any,null>(Api.getRoleSave, { roleName });
};